package com.module.home;

import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.orhanobut.logger.Logger;


import ren.nearby.http.base.BaseActivity;

/**
 * Created by Administrator on 2017/8/3 0003.
 */

public class HomeActivity extends BaseActivity {

    @Override
    public String showTitle() {
        return getResources().getString(R.string.home_home);
    }

    @Override
    public boolean isShowLeftIcon() {
        return true;
    }



    @Override
    public void onClickLeft(View v) {
        super.onClickLeft(v);
        Logger.e("on left");
    }


    @Override
    public int getContentView() {
        return R.layout.home_home;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Uri uri = getIntent().getData();
        if (uri != null) {
            String value1 = uri.getQueryParameter("value1");
            String value2 = uri.getQueryParameter("value2");
            String value3 = uri.getQueryParameter("value3");
            setTitle(value1 + " - " + value2 + " - " + value3);
            if (value3 != null) {
                setResult(121);
                finish();
            }
        } else {
            String  title = getIntent().getStringExtra("title");
            if(title!=null){
                setTitle(title);
            }
        }

        Logger.e(" Home 组件");
    }

}
